package com.iwhalecloud.citybrain.flow.platform.manager.application.service.impl;

import java.util.List;

import com.iwhalecloud.citybrain.flow.platform.manager.application.service.FlowUserTaskExpressionResolverService;
import com.iwhalecloud.citybrain.flow.platform.manager.domain.repository.FlowUserTaskExpressionResolveRepository;
import org.flowable.engine.delegate.DelegateExecution;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author lilh
 * @date 2020/11/6 09:35
 */
@Service
public class FlowUserTaskExpressionResolverServiceImpl implements FlowUserTaskExpressionResolverService {

    @Autowired
    private FlowUserTaskExpressionResolveRepository flowUserTaskExpressionResolveRepository;

    @Override
    public String resolveAssignee(DelegateExecution execution) {
        return flowUserTaskExpressionResolveRepository.resolveAssignee(execution);
    }

    @Override
    public List<String> resolveCandidateUsers(DelegateExecution execution) throws Exception {
        return flowUserTaskExpressionResolveRepository.resolveCandidate(execution);
    }

    @Override
    public List<String> resolveCandidateGroups(DelegateExecution execution) throws Exception {
        return flowUserTaskExpressionResolveRepository.resolveCandidate(execution);
    }
}
